package com.example.tests;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

import org.testng.annotations.Test;

import com.example.fw.GroupObject;
import com.example.fw.Groups;

public class ModifyGroupTests extends TestBase {
	
 	@Test
	public void testModifyFirstGroup() throws Exception {
		GroupObject validGroup = new GroupObject()
	    	.setName("newname").setHeader("editlogo").setFooter("editcomment");
 		Groups oldList = app.getGroupHelper().getGroups(); 
		GroupObject groupToEdit = oldList.getOneGroup();
  		groupToEdit.setName(validGroup.name);
		System.out.println("Get "+groupToEdit.id + " id group.");
 		app.getGroupHelper().modifyGroup(groupToEdit.id, validGroup);
  		Groups newList = app.getGroupHelper().getGroups();  
		assertThat(newList, equalTo(oldList));
	}
}